package com.xiaoshi.common;


import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.Date;

// 拓展了在线用户信息
public class MyResUser  extends User {

    private static final long serialVersionUID = -6411066541689297219L;

    private Long userId;

    private String avatar;

    private String email;

    private String mobile;

    private String sex;

    private Long deptId;

    private String deptName;

    private String roleId;

    private String roleName;

    private Date lastLoginTime;

    private String description;

    private String status;

    private Integer type;

    private Integer fid;

    private Integer uId;

    private String jobName;

    private String jobNo;




    /**
     *  0 是后台用户   1是 小程序用户   -1 是 客户端接口
     */
    private Integer userType ;

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = 0;
    }

    public Integer getFid() {
        return fid;
    }

    public void setFid(Integer fid) {
        this.fid = fid;
    }


    //    public MyResUser() {
//        super(null, null, null);
//    }



    public MyResUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public MyResUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobNo() {
        return jobNo;
    }

    public void setJobNo(String jobNo) {
        this.jobNo = jobNo;
    }





    public Integer getuId() {
        return uId;
    }

    public void setuId(Integer uId) {
        this.uId = uId;
    }



    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "MyResUser{" +
                "userId=" + userId +
                ", avatar='" + avatar + '\'' +
                ", email='" + email + '\'' +
                ", mobile='" + mobile + '\'' +
                ", sex='" + sex + '\'' +
                ", deptId=" + deptId +
                ", deptName='" + deptName + '\'' +
                ", roleId='" + roleId + '\'' +
                ", roleName='" + roleName + '\'' +
                ", lastLoginTime=" + lastLoginTime +
                ", description='" + description + '\'' +
                ", status='" + status + '\'' +
                '}';
    }


    public MyResUser(String username, String password, Collection<? extends GrantedAuthority> authorities, Long userId, String avatar, String email, String mobile, String sex, Long deptId, String deptName, String roleId, String roleName, Date lastLoginTime, String description, String status, Integer type, Integer fid, Integer uId, String jobName, String jobNo, Integer userType) {
        super(username, password, authorities);
        this.userId = userId;
        this.avatar = avatar;
        this.email = email;
        this.mobile = mobile;
        this.sex = sex;
        this.deptId = deptId;
        this.deptName = deptName;
        this.roleId = roleId;
        this.roleName = roleName;
        this.lastLoginTime = lastLoginTime;
        this.description = description;
        this.status = status;
        this.type = type;
        this.fid = fid;
        this.uId = uId;
        this.jobName = jobName;
        this.jobNo = jobNo;
        this.userType = userType;
    }

    public MyResUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities, Long userId, String avatar, String email, String mobile, String sex, Long deptId, String deptName, String roleId, String roleName, Date lastLoginTime, String description, String status, Integer type, Integer fid, Integer uId, String jobName, String jobNo, Integer userType) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.userId = userId;
        this.avatar = avatar;
        this.email = email;
        this.mobile = mobile;
        this.sex = sex;
        this.deptId = deptId;
        this.deptName = deptName;
        this.roleId = roleId;
        this.roleName = roleName;
        this.lastLoginTime = lastLoginTime;
        this.description = description;
        this.status = status;
        this.type = type;
        this.fid = fid;
        this.uId = uId;
        this.jobName = jobName;
        this.jobNo = jobNo;
        this.userType = userType;
    }
}
